package interview;
//面试题 01.07. 旋转矩阵
public class Num01_07_rotate {
    public void rotate(int[][] matrix) {
        int[][]ans = new int[matrix.length][matrix[0].length];
        int n = matrix.length;
        for (int i = 0; i < matrix.length; i++) {
            for (int j = 0; j < matrix.length; j++) {
                ans[j][matrix.length - i - 1] = matrix[i][j];
            }
        }
        for (int i = 0; i < matrix.length; i++) {
            for (int j = 0; j < matrix.length; j++) {
                matrix[i][j] = ans[i][j];
            }
        }


    }
}
